import { http } from "@/utils/http";

export type commonResult<T> = {
  code: number;
  msg: string;
  result: T;
};

/** 3.1.2.1 工单列表 */
export const getInspectionDetail = (params?: object) => {
  return http.request<commonResult<any>>("get", '/screen/statistic/v2/work-orders', {
    params
  });
};
/** 3.1.2.2 工单详情 */
export const getInspectionDetailFacilities = (params?: object) => {
  return http.request<commonResult<any>>("get", '/screen/statistic/v2/work-order-info', {
    params
  });
};
/** 3.1.2.3 发起工单 */
export const sendOrder = (data?: object) => {
  return http.request<commonResult<any>>("post", "/screen/statistic/v2/work-order", {
    data
  });
};
/** 3.1.2.7 删除工单(批量) */
export const deleteOrder = (data?: object) => {
  return http.request<commonResult<any>>("delete", "/screen/statistic/v2/work-order", {
    data
  });
};
/** 3.1.2.4 工单处理 */
export const handleOrder = (data?: object) => {
  return http.request<commonResult<any>>("put", "/screen/statistic/v2/work-order/deal", {
    data
  })
};
/** 3.1.2.5 编辑工单 */
export const editOrder = (data?: object) => {
  return http.request<commonResult<any>>("put", "/screen/statistic/v2/work-order", {
    data
  })
};
/** 3.1.2.6 撤销工单 */
export const cancelOrder = (data?: object) => {
  return http.request<commonResult<any>>("put", "/screen/statistic/v2/work-order/cancel", {
    data
  })
};